#include <bits/stdc++.h>
using namespace std;
int main() 
{
    int a = 0, b = 0;
    for (int i = 1; i < 1001; ++i) 
	{
        int n = i;
        int aa = 0, bb = 0;
        while (n != 0) {
            if (n % 2) aa++; else bb++;
            n /= 2;
        }
        if (aa > bb)a++; else b++;
    }
    cout << a << " " << b;
}
